{% extends 'base.html' %}
{% load alterflow_tags %}

{% block head %}
  审批页
{% endblock %}

{% block content %}
    <ol class="breadcrumb" style="margin-bottom: 0;">
        <li><a href="#" style="font-size: large">变更管理</a></li>
        <li class="active" style="font-size: large">需要我审批的流程</li>
        <li class="active" style="font-size: large">审批页面</li>
    </ol>

    <div class="panel">
        <div class="panel-heading">
            <h3 ><a href="{% url 'workflow:show_alter' flow_record_objective.flow.alter_id %}">{{ flow_record_objective.flow }}</a></h3>
        </div>

        <!-- Striped Table -->
        <!--===================================================-->
        <div class="panel-body">
            <div class="table-responsive">
                <table class="table table-striped table-hover">
                    {% get_flow_records flow_record_objective as flow_record_objectives %}
                    <thead>
                        <tr>
                            <td>环节</td>
                            <td>环节名称</td>
                            <td>审批人</td>
                            <td>审批意见</td>
                            <td>审批结果</td>
                            <td>审批日期</td>
                        </tr>
                    </thead>
                    <tbody>
                        {% for record_obj in flow_record_objectives   %}
                        <tr>
                            <td>{{ record_obj.step.order }}</td>
                            <td>{{ record_obj.step.name }}</td>
                            <td>
                            {% if record_obj.user %}
                                <a href="{% url 'users:user_info' record_obj.user.id %}">{{ record_obj.user }}</a>
                            {% else %}
                                当前操作者
                            {% endif %}

                            </td>
                            <td>{{ record_obj.comment|default:"正在撰写" }}</td>
                            <td>{{ record_obj.get_status_display }}</td>
                            <td>{% if record_obj.user %}
                                    {{ record_obj.date }}
                                {% endif %}
                            </td>
                        </tr>
                        {% endfor %}
                    </tbody>

                </table>
            </div>

            <form class="form" method="post">{% csrf_token %}
                <div class="row">
                    <div class="col-md-12">
                    <h3>{{ flow_record_objective}}</h3>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        {{ form.comment.label }}
                        {{ form.comment }}
                    </div>
                    <div class="col-md-4" style="margin-top:20px">
                            {{ form.status.label }}
                            {{ form.status }}

                    </div>
                    <div class="col-lg-12" style="margin-top:20px">
                            <input type="submit" class="btn btn-success">
                    </div>


                </div>

            </form>

        </div>


    </div>


{% endblock %}
